define(function (require, exports, module) {
	$("#updatePwdForm").validate({
        rules: {
            'payPwd': {
                required: true,
				regexPassword:true
            },
            'newPayPwd': {
                required: true,
				regexPassword:true
            },
            'confirmNewPayPwd': {
                required: true,
				equalTo: "#newPayPwd"
            }
        },
        messages: {
        	'payPwd': {
        		required: "请输入旧密码",
				regexPassword:'新密码格式错误'
            },
            'newPayPwd': {
            	required: "至少8到16位英文和数字",
				regexPassword:'新密码格式错误'
            },
            'confirmNewPayPwd': {
            	required: "请再输一次新密码",
				equalTo: "两次密码不一致"
            }
        },
        submitHandler: function (form, event, validator) {
            $(form).ajaxSubmit(function (data) {
                var code = data.resCode;
                if (code==1) {
            		window.location.href = "/mobile/usercenter/security/setting.html";                	
                } else {
                    layer.alert(data.resMsg);
                }
            });
        }
    });
});